import React from "react";
import { Navigate } from "react-router-dom";
const Home = React.lazy(() => import("../views/home"));
const My = React.lazy(() => import("../views/my"));
const Login = React.lazy(() => import("../views/login"));
const MainLayout = React.lazy(() => import("../views/mainLayout"));
const Order = React.lazy(() => import("../views/order"));
const OrderQuery = React.lazy(() => import("../views/orderQuery"));

export const routes = [
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    children: [
      {
        path: "/home",
        element: <Home></Home>,
      },
      {
        path: "/my",
        element: <My></My>,
      },
      {
        path: "/",
        element: <Navigate to="/home"></Navigate>,
      },
    ],
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/order",
    element: <Order></Order>,
  },
  {
    path: "/order/query",
    element: <OrderQuery></OrderQuery>,
  },
];
